import React from "react";
import styles from './index.less';

export default function HtmlImageRenderer({ html }:{html: string}) {
  const fixedHtml = (html || '').replace(/<img([^>]+)data-src="([^"]+)"/g, (match, before, realSrc) => {
    return `<img${before}src="${realSrc}"`;
  });
  return <div className={styles.content} dangerouslySetInnerHTML={{ __html: fixedHtml }} />;
}
